package com.android.mmchat.manager;

import android.content.Context;
import android.widget.Toast;

public class OtherManager {
	private static Toast toast=null;
	
	/**
	 * Toast消息
	 */
	public static void Toast(Context ctx,int stringId){
		if(toast!=null){
			toast.setText(ctx.getResources().getString(stringId));
			toast.setDuration(Toast.LENGTH_SHORT);
		}else{
			toast=Toast.makeText(ctx,ctx.getResources().getString(stringId) ,Toast.LENGTH_SHORT);
		}
		toast.show();	
	}
	public static void Toast(Context ctx,String string){
		if(toast!=null){
			toast.setText(string);
			toast.setDuration(Toast.LENGTH_SHORT);
		}else{
			toast=Toast.makeText(ctx,string,Toast.LENGTH_SHORT);
		}
		toast.show();	
	}	
	/**
	 * 打印Log信息
	 */
	public static void print(String string){
		System.out.println(string);
	}
	
	
	/**
	 * 没有网络时的提示
	 */
//	public static void NoAvilableNetwork(final Context ctx,DialogInterface.OnClickListener cancelListener){
//		new AlertDialog.Builder(ctx)
//		.setTitle(R.string.notice)
//		.setMessage(R.string.noavilableNetwork)
//		.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener(){
//			public void onClick(DialogInterface dialog, int which) {
//				// TODO Auto-generated method stub
//				ctx.startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS)); //进入无线网络配置界面 
//			}
//		}).setNegativeButton(R.string.cancel, cancelListener).show();
//	}
}
